package com.etc.entity;

import java.util.ArrayList;
import java.util.List;

public class PageModel<T> {
	// 分页信息
	private int totalRecord;// 总记录数

	public int getTotalRecord() {
		return totalRecord;
	}

	public void setTotalRecord(int totalRecord) {
		this.totalRecord = totalRecord;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	/**
	 * if(totalRecord % pageSize ==0){ totalPage = totalRecord / pageSize;
	 * }else{ totalPage = totalRecord / pageSize+1; }
	 * 
	 * @return
	 */
	public int getTotalPage() {
		if (totalRecord % pageSize == 0) {
			totalPage = totalRecord / pageSize;
		} else {
			totalPage = totalRecord / pageSize + 1;
		}
		return totalPage;

	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	private int pageSize;// 每页几条
	private int totalPage;// 总页数
	private int currentPage;// 当前页

	// 当前页的数据列表
	List<T> list = new ArrayList<T>();
}
